<@master template="master/master-loan" title="图形报表">

	   <div id="main" style="width: 1000px;height:400px;"></div>
	   
     <@js>
        
        $(function(){
         // 基于准备好的dom，初始化echarts实例
		    var myChart = echarts.init(document.getElementById('main'));
     	
			$.ajax({url:"restEcharts/mapDetailForObject",
     			data:{},
     			dataType:"json",
     			type : 'post',
     			success:function(result){
		     			  var nameArray =['放款金额','银行正常贷款余额','银行逾期贷款余额','代偿贷款金额','代偿贷款欠还余额'];
				          var l=eval(result.data);
				          var dataArray1=  l.fkje;         
						  var dataArray2= l.yhzcdjye; 
						  var dataArray3= l.yhyqdjye; 
						  var dataArray4=  l.dcdkye; 
						  var dataArray5=  l.dcdkqhye;
						  
						  var option = {
						    title: {
						        text: '放款余额',
						        left: 'center'
						    },
						    tooltip: {
						        trigger: 'item',
						        formatter: function(params) {  
						                var res = params.name+'<br/>';  
						                var myseries = option.series;  
						                for (var i = 0; i < myseries.length; i++) {  
						                    for(var j=0;j<myseries[i].data.length;j++){  
						                        if(myseries[i].data[j].name==params.name){  
						                            res+=myseries[i].name +' : '+myseries[i].data[j].value+'</br>';  
						                        }  
						                    }  
						                }  
						                return res;  
						            }  
						    },
						    legend: {
						        orient: 'vertical',
						        left: 'left',
						        data:nameArray
						    },
						    visualMap: {
						        min: 0,
						        max: 16111002500,
						        left: 'left',
						        top: 'bottom',
						        text: ['高','低'],           // 文本，默认为数值文本
						        calculable: true
						    },
						    toolbox: {
						        show: true,
						        orient: 'vertical',
						        left: 'right',
						        top: 'center',
						        feature: {
						            dataView: {readOnly: false},
						            restore: {},
						            saveAsImage: {}
						        }
						    },
						    series: [
						        {
						            name: '放款金额',
						            type: 'map',
						            mapType: 'china',
						            roam: 'scale',
						            label: {
						                normal: {
						                    show: true
						                },
						                emphasis: {
						                    show: true
						                }
						            },
						            data:dataArray1
						        },
						        {
						            name: '银行正常贷款余额',
						            type: 'map',
						            mapType: 'china',
						            label: {
						                normal: {
						                    show: true
						                },
						                emphasis: {
						                    show: true
						                }
						            },
						            data:dataArray2
						        },
						        {
						            name: '银行逾期贷款余额',
						            type: 'map',
						            mapType: 'china',
						            label: {
						                normal: {
						                    show: true
						                },
						                emphasis: {
						                    show: true
						                }
						            },
						            data:dataArray3
						        }
						,
						        {
						            name: '代偿贷款金额',
						            type: 'map',
						            mapType: 'china',
						            label: {
						                normal: {
						                    show: true
						                },
						                emphasis: {
						                    show: true
						                }
						            },
						            data:dataArray4
						        }
						    ,
						        {
						            name: '代偿贷款欠还余额',
						            type: 'map',
						            mapType: 'china',
						            label: {
						                normal: {
						                    show: true
						                },
						                emphasis: {
						                    show: true
						                }
						            },
						            data:dataArray5
						        }
						    ]
						};
			
			            // 使用刚指定的配置项和数据显示图表。
			            myChart.setOption(option);
			  	}
			  
			  });                       
			            
			            
	     });
    </@js>
</@master>
